package com.apartment.own.mapper;

import java.util.List;
import com.apartment.own.domain.OwnSysWorkOrder;
import com.apartment.own.request.workorder.OwnSysWorkOrderQuery;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 维修订单Mapper接口
 * 
 * @author @Dog_E
 * @date 2020-08-28
 */
public interface OwnSysWorkOrderMapper extends BaseMapper<OwnSysWorkOrder>
{
    /**
     * 查询维修订单
     * 
     * @param id 维修订单ID
     * @return 维修订单
     */
    public OwnSysWorkOrder selectOwnSysWorkOrderById(String id);

    /**
     * 查询维修订单列表
     * 
     * @param ownSysWorkOrder 维修订单
     * @return 维修订单集合
     */
    public List<OwnSysWorkOrder> selectOwnSysWorkOrderList(OwnSysWorkOrder ownSysWorkOrder);

    /**
     * 条件批量查询工单
     * @param
     * @return
     */
    @Select("select worked.*,room.*,houses.* from own_sys_work_order worked  left join own_res_house_room_conf room on worked.house_resource_id = room.id left join own_res_house_resource houses on room.key_resource_id=houses.id ${ew.customSqlSegment}")
    public List<OwnSysWorkOrder> selectOwnSysWorkOrderLists( @Param(Constants.WRAPPER) Wrapper wrapper);

    /**
     * 新增维修订单
     * 
     * @param ownSysWorkOrder 维修订单
     * @return 结果
     */

    public int insertOwnSysWorkOrder(OwnSysWorkOrder ownSysWorkOrder);

    /**
     * 修改维修订单
     * 
     * @param ownSysWorkOrder 维修订单
     * @return 结果
     */
    public int updateOwnSysWorkOrder(OwnSysWorkOrder ownSysWorkOrder);

    /**
     * 删除维修订单
     * 
     * @param id 维修订单ID
     * @return 结果
     */
    public int deleteOwnSysWorkOrderById(String id);

    /**
     * 批量删除维修订单
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteOwnSysWorkOrderByIds(String[] ids);

}
